package com.xiaobias.a01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

@Component
public class Component1 {
     private static final Logger logger = LoggerFactory.getLogger(Component1.class);

    @Autowired
     private ApplicationEventPublisher applicationEventPublisher;

     public void register() {
          logger.debug("注册");
          applicationEventPublisher.publishEvent(new UserRegisteredEvent(this));
     }
}
